<?php
defined('IN_XLP') or exit('Access Denied');
$Document = array(
	'pageid'   => 'finance-refund', //页面标示
	'pagename' => '退货退款', //当前页面名称
	'mycss'	=> array('../jquery-ui/css/smoothness/jquery-ui-1.10.0.custom.min'), //加载的css样式表
	'myjs'	 => array(), //加载的js脚本
	'footerjs' => array('../jquery-ui/js/jquery-ui-1.10.0.custom.min', '../jquery-ui/js/jquery-ui-timepicker-addon'),
	'head'	 => true, //加载头部文件
);
include getTpl('header', 'public');
?>
<style>
.tc{text-align:center;}
tbody tr td{text-align:center;}
.info_btn{line-height:14px;color:#FFF;background:#37A225;border-radius:4px;text-align:center;display:inline-block;height:20px;padding:3px 10px;}
.info_btn:hover{color:#37A225;background:#FFF;border:1px solid #37A225;}
.refund_btn{line-height:14px;color:#FFF;background:#F5491E;border-radius:4px;text-align:center;display:inline-block;height:20px;padding:3px 10px;}
.refund_btn:hover{color:#F5491E;background:#FFF;border:1px solid #F5491E;}
</style>
<!--顶部导航 开始-->
<?php include getTpl('top', 'public');?>
<!--顶部导航 结束-->
<!--左侧菜单 开始-->
<?php include getTpl('nav', 'public');?>
<!--左侧菜单 结束-->
<!--主体 开始-->
<!-- content -->
<section id="content">
	<!-- main padder -->
	<section class="main padder">
		<div class="clearfix">
			<h4><i class="fa fa-table"></i>退款订单</h4>
			<section class="panel">
				<header class="panel-heading bg-white">申请退款/退货订单列表</header>
				<div class="panel-body">

					<div class="row text-small" style="text-align:center">
						<form action="<?php echo U('content/finance/refund'); ?>" method="get">
							<input type="hidden" name="g" value="content">
							<input type="hidden" name="c" value="finance">
							<input type="hidden" name="m" value="refund">
							<div class="col-sm-2 m-b-mini">
								<label for="">开始时间 <input class="input-sm" name="starttime" id="starttime" size="16" type="text" value="<?php echo $starttime; ?>" readonly></label>
							</div>
							<div class="col-sm-2">
								<label for="">结束时间 <input class="input-sm" name="endtime" id="endtime" size="16" type="text" value="<?php echo $endtime; ?>" readonly></label>
							</div>
							<div class="col-sm-1" style="width:4%">
								<div class="input-group">
									<button class="btn btn-sm btn-white" type="submit">确定</button>
								</div>
							</div>
							<div class="col-sm-1">
								<div class="input-group">
									<a class="btn btn-sm btn-white" href="<?php echo U('content/finance/refund',array(),true); ?>">重置</a>
								</div>
							</div>
						</form>
					</div>
					
					<div class="table-responsive">
						<table class="table table-striped b-t text-small">
							<thead>
								<tr>
                                    <th class="tc" width="100">订单ID</th>
									<th class="tc" width="150">订单编号</th>
									<th class="tc">商品</th>
									<th class="tc" width="50">运费</th>
									<th class="tc" width="120">申请退款总额</th>
                                    <th class="tc" width="120">申请退货总数</th>
                                    <th class="tc" width="100">订单总计</th>
                                    <th class="tc" width="100">结邻币</th>
                                    <th class="tc" width="100">实付</th>
                                    <th class="tc" width="100">申请时间</th>
                                    <th class="tc" width="100">处理时间</th>
									<th class="tc" width="100">退款时间</th>
									<th class="tc" width="100">状态</th>
									<th class="tc" width="150">操作</th>
								</tr>
							</thead>
							<tbody>
								<?php foreach ($list as $k => $v): ?>
								<tr>
								<td><?php echo $v['order_id']; ?></td>
								<td><?php echo $v['order_sn']; ?></td>
								<td style="text-align:left;">
									<?php foreach ($v['refund_goods'] as $key => $value): ?>
									<?php echo $value['goods_name'].' (￥'.$value['goods_price'].'x'.$value['goods_num'].')<br>'; ?>
									<?php endforeach ?>
								</td>
								<td><?php echo '￥'.$v['shipping_fee']; ?></td>
								<td><?php echo '￥'.$v['order_refund']; ?></td>
								<td><?php echo $v['order_return']; ?></td>
								<td><?php echo '￥'.$v['order_amount']; ?></td>
								<td><?php echo $v['score_used']; ?></td>
								<td><?php echo '￥'.$v['actual_pay']; ?></td>
								<td><?php echo $v['return_time']; ?></td>
								<td><?php echo $v['service_time']; ?></td>
								<td><?php echo $v['finance_time']; ?></td>
								<td><?php echo $v['refund_state']; ?></td>
								<td><?php echo $v['refund_btn']; ?></td>
								</tr>
								<?php endforeach ?>
							</tbody>
						</table>		
					</div>
					
					<footer class="panel-footer">
						<div class="row">
							<div class="col-sm-12 text-right text-center-sm">
								<?php echo page($total,$page,'', 20, 'page');?>
							</div>
						</div>
					</footer>

				</div>
			</section>
		</div>
	</section>
	<!--/ main padder -->
</section>
<!--/ content -->
<!--主体 结束-->
<script>
$(function () {
	$('#starttime').datetimepicker();
	$('#endtime').datetimepicker();
});
</script>
<?php include getTpl('footer', 'public'); ?>